#include "hack.h"

const char *get_qnt(const char *oname)
{
	int i = 0;
	char *result = "";
	while ( !(obj_descr[i].oc_name == 0 && obj_descr[i].oc_descr == 0))
	{
		if (obj_descr[i].oc_tname  == 0)
		{
		    i++;
			continue;
		}
		if (strncmp(obj_descr[i].oc_tname, oname, strlen(obj_descr[i].oc_tname)) == 0)
		{
			result = obj_descr[i].qnt;
			goto end;
		}
		i++;
	}
	i = 0;
	while (*(mons[i].mname) != 0)
	{
		if (strncmp(mons[i].tname, oname, strlen(mons[i].tname)) == 0)
		{
			result = mons[i].qnt;
			goto end;
		}
		i++;
	}
	end:
	return result;
}
